﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Sealight.Core.DataAdapter;

namespace Sealight.UI.WebUI.UIHelpers
{
    public class SessionVariables
    {
        public static string CURRENT_LOGIN_USER = "CURRENT_LOGIN_USER";        
    }

    public class SessionWrapper
    {
        public static void SetLoginUser(user u)
        {
            System.Web.HttpContext.Current.Session.Add(UIHelpers.SessionVariables.CURRENT_LOGIN_USER, u);
        }
        public static user GetLoginUser()
        {
            user m = null;
            if (System.Web.HttpContext.Current.Session[UIHelpers.SessionVariables.CURRENT_LOGIN_USER] != null)
                m = System.Web.HttpContext.Current.Session[UIHelpers.SessionVariables.CURRENT_LOGIN_USER] as user;
            return m;
        }
    }
}